<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 7.1.1">

  <link rel="apple-touch-icon" sizes="180x180" href="/images/avatar.jpg">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/avatar.jpg">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/avatar.jpg">
  <link rel="mask-icon" href="/images/avatar.jpg" color="#222">
  <meta name="msvalidate.01" content="4AF2328B2035748153A041B7EEF3D15C">

<link rel="stylesheet" href="/css/main.css">

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Noto+Serif+SC:300,300italic,400,400italic,700,700italic%7CLobster:300,300italic,400,400italic,700,700italic%7CPingFang+SC:300,300italic,400,400italic,700,700italic%7CRoboto+Mono:300,300italic,400,400italic,700,700italic&display=swap&subset=latin,latin-ext">

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha256-wiz7ZSCn/btzhjKDQBms9Hx4sSeUYsDrTLg7roPstac=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.33/fancybox/fancybox.css" integrity="sha256-gkQVf8UKZgQ0HyuxL/VnacadJ+D2Kox2TCEBuNQg5+w=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"ethanliu6.github.io","root":"/","images":"/images","scheme":"Gemini","darkmode":false,"version":"8.19.2","exturl":true,"sidebar":{"position":"left","display":"always","padding":12,"offset":18},"copycode":{"enable":true,"style":"mac"},"fold":{"enable":true,"height":300},"bookmark":{"enable":true,"color":"#222","save":"manual"},"mediumzoom":true,"lazyload":true,"pangu":false,"comments":{"style":"buttons","active":"changyan","storage":true,"lazyload":false,"nav":null,"activeClass":"changyan"},"stickytabs":false,"motion":{"enable":true,"async":false,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":6,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>

    <meta name="description" content="JavaSE进阶——Day10-11 随堂小记">
<meta property="og:type" content="article">
<meta property="og:title" content="JavaSE进阶——Day10-11 随堂小记">
<meta property="og:url" content="http://ethanliu6.github.io/2024/04/30/JavaNotes/JavaSE%E8%BF%9B%E9%98%B6/day11/JavaSE%E8%BF%9B%E9%98%B6%E2%80%94%E2%80%94Day10-11-%E9%9A%8F%E5%A0%82%E5%B0%8F%E8%AE%B0/index.html">
<meta property="og:site_name" content="&lt;font color&#x3D;&#39;white&#39; &gt;Ethan の Blog&lt;&#x2F;font&gt;">
<meta property="og:description" content="JavaSE进阶——Day10-11 随堂小记">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2024-04-30T14:33:08.389Z">
<meta property="article:modified_time" content="2024-04-30T14:33:08.389Z">
<meta property="article:author" content="Ethan Liu">
<meta property="article:tag" content="Java">
<meta property="article:tag" content="Java进阶">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="http://ethanliu6.github.io/2024/04/30/JavaNotes/JavaSE%E8%BF%9B%E9%98%B6/day11/JavaSE%E8%BF%9B%E9%98%B6%E2%80%94%E2%80%94Day10-11-%E9%9A%8F%E5%A0%82%E5%B0%8F%E8%AE%B0/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"http://ethanliu6.github.io/2024/04/30/JavaNotes/JavaSE%E8%BF%9B%E9%98%B6/day11/JavaSE%E8%BF%9B%E9%98%B6%E2%80%94%E2%80%94Day10-11-%E9%9A%8F%E5%A0%82%E5%B0%8F%E8%AE%B0/","path":"2024/04/30/JavaNotes/JavaSE进阶/day11/JavaSE进阶——Day10-11-随堂小记/","title":"JavaSE进阶——Day10-11 随堂小记"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>JavaSE进阶——Day10-11 随堂小记 | <font color='white' >Ethan の Blog</font></title>
  








  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
<style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title"><font color='white' >Ethan の Blog</font></p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description"><font color='#FDABC1' size=3>清醒的停留，胜过——盲目的前行</font></p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li><li class="menu-item menu-item-关于我"><a href="/aboutme/" rel="section"><i class="fa fa-user fa-fw"></i>关于我</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签<span class="badge">18</span></a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类<span class="badge">14</span></a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档<span class="badge">53</span></a></li><li class="menu-item menu-item-love"><a href="/categories/Love/" rel="section"><i class="fas fa-heart fa-fw"></i>Love</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#properties"><span class="nav-number">1.</span> <span class="nav-text">Properties</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E9%80%92%E5%BD%92"><span class="nav-number">2.</span> <span class="nav-text">递归</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%AD%97%E7%AC%A6%E6%B5%81"><span class="nav-number">3.</span> <span class="nav-text">字符流</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%BC%96%E7%A0%81%E8%A1%A8"><span class="nav-number">3.1.</span> <span class="nav-text">编码表</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E8%BD%AC%E6%8D%A2%E6%B5%81"><span class="nav-number">4.</span> <span class="nav-text">转换流</span></a></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Ethan Liu"
      src="/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">Ethan Liu</p>
  <div class="site-description" itemprop="description"><font color='#0000FF' size=1.5px>语言学 | NLP | Py | Java</font></div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">53</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">14</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">18</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author animated">
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL2V0aGFubGl1Ng==" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;ethanliu6"><i class="fab fa-github fa-fw"></i>GitHub</span>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="bWFpbHRvOmxpdWUyMzM2QGdtYWlsLmNvbQ==" title="E-Mail → mailto:liue2336@gmail.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</span>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cHM6Ly9zcGFjZS5iaWxpYmlsaS5jb20vMTMyNzA5OTk3Nw==" title="BiliBili → https:&#x2F;&#x2F;space.bilibili.com&#x2F;1327099977"><i class="fa-brands fa-bilibili fa-fw"></i>BiliBili</span>
      </span>
      <span class="links-of-author-item">
        <a href="/categories/Love/" title="Love → &#x2F;categories&#x2F;Love&#x2F;" rel="noopener me"><i class="fa fa-heart fa-fw"></i>Love</a>
      </span>
  </div>

        </div>
      </div>
    </div>

    
  </aside>


    </div>

    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://ethanliu6.github.io/2024/04/30/JavaNotes/JavaSE%E8%BF%9B%E9%98%B6/day11/JavaSE%E8%BF%9B%E9%98%B6%E2%80%94%E2%80%94Day10-11-%E9%9A%8F%E5%A0%82%E5%B0%8F%E8%AE%B0/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.jpg">
      <meta itemprop="name" content="Ethan Liu">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="<font color='white' >Ethan の Blog</font>">
      <meta itemprop="description" content="<font color='#0000FF' size=1.5px>语言学 | NLP | Py | Java</font>">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="JavaSE进阶——Day10-11 随堂小记 | <font color='white' >Ethan の Blog</font>">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          JavaSE进阶——Day10-11 随堂小记<span class="exturl post-edit-link" data-url="aHR0cHM6Ly9naXRodWIuY29tL0V0aGFuTGl1Ni9ldGhhbmxpdTYuZ2l0aHViLmlvL3RyZWUvbWFzdGVyL19wb3N0cy9KYXZhTm90ZXMvSmF2YVNF6L+b6Zi2L2RheTExL0phdmFTRei/m+mYtuKAlOKAlERheTEwLTExLemaj+WgguWwj+iusC5tZA==" title="编辑"><i class="fa fa-pen-nib"></i></span>
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2024-04-30 22:33:08" itemprop="dateCreated datePublished" datetime="2024-04-30T22:33:08+08:00">2024-04-30</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/Java%E5%85%A8%E6%A0%88/" itemprop="url" rel="index"><span itemprop="name">Java全栈</span></a>
        </span>
    </span>

  
    <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv">
      <span class="post-meta-item-icon">
        <i class="far fa-eye"></i>
      </span>
      <span class="post-meta-item-text">阅读次数：</span>
      <span id="busuanzi_value_page_pv"></span>
    </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Changyan：</span>
    
    <a title="JavaSE进阶——Day10-11 随堂小记" href="/2024/04/30/JavaNotes/JavaSE%E8%BF%9B%E9%98%B6/day11/JavaSE%E8%BF%9B%E9%98%B6%E2%80%94%E2%80%94Day10-11-%E9%9A%8F%E5%A0%82%E5%B0%8F%E8%AE%B0/#SOHUCS" itemprop="discussionUrl">
      <span id="sourceId::1502379c0afe7ad5cc2fbcbd302858b9" class="cy_cmt_count" itemprop="commentCount"></span>
    </a>
  </span>
  
  
    <span class="post-meta-break"></span>
    <span class="post-meta-item" title="本文字数">
      <span class="post-meta-item-icon">
        <i class="far fa-file-word"></i>
      </span>
      <span class="post-meta-item-text">本文字数：</span>
      <span>1.2k</span>
    </span>
    <span class="post-meta-item" title="阅读时长">
      <span class="post-meta-item-icon">
        <i class="far fa-clock"></i>
      </span>
      <span class="post-meta-item-text">阅读时长 &asymp;</span>
      <span>5 分钟</span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody"><blockquote class="blockquote-center">
<p>JavaSE进阶——Day10-11 随堂小记</p>

</blockquote>
<span id="more"></span>
<p>IO流中的必须掌握的内容：</p>
<ol type="1">
<li><p>Properties</p></li>
<li><p>基础流（字节流、字符流）</p></li>
<li><p>概念：缓冲区（缓冲流的思想）</p></li>
<li><p>编码表（在开发过程中，乱码经常出现）
//编码和解码保证使用相同的编码表</p>
<ul>
<li><p>编码</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="type">String</span> <span class="variable">str</span> <span class="operator">=</span> <span class="string">&quot;黑马&quot;</span>;</span><br><span class="line"><span class="type">byte</span>[] buf = str.getBytes();</span><br></pre></td></tr></table></figure></li>
<li><p>解码</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="type">byte</span>[] buf = &#123;-<span class="number">21</span>, -<span class="number">13</span>, -<span class="number">38</span>&#125;;</span><br><span class="line"><span class="type">String</span> <span class="variable">str</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">String</span>(buf);</span><br><span class="line"></span><br><span class="line"><span class="type">String</span> <span class="variable">str</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">String</span>(buf , <span class="string">&quot;编码表名字&quot;</span>);</span><br></pre></td></tr></table></figure></li>
</ul></li>
<li><p>使用转换流读写特定编码的文件</p></li>
<li><p>序列化流（概念：序列化）</p></li>
</ol>
<p>复习：线程通讯</p>
<ul>
<li><p>线程通讯：在A线程运行的过程中，可以去叫醒其他处于"等待状态"的线程</p></li>
<li><p>线程通讯，需要使用到：等待唤醒机制</p>
<ul>
<li>等待：wait()</li>
<li>唤醒：notify()、notifyAll()</li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">同步代码块(对象锁)&#123;</span><br><span class="line">    对象锁.wait();</span><br><span class="line">    </span><br><span class="line">    </span><br><span class="line">    对象锁.notify();<span class="comment">//唤醒和当前对象锁绑定的其他处于等待状态的线程</span></span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">非静态的同步方法()&#123; <span class="comment">//对象锁：this</span></span><br><span class="line">    <span class="built_in">this</span>.wait();</span><br><span class="line">    </span><br><span class="line">    </span><br><span class="line">    <span class="built_in">this</span>.notify();</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></li>
</ul>
<p>复习：IO流</p>
<ul>
<li>IO流的作用：对磁盘上的文件进行读、写操作
<ul>
<li>读：把文件中的数据，读取到内存中</li>
<li>写：把内存中的数据，写入到文件中（持久化存储）</li>
</ul></li>
<li>IO流分类：
<ul>
<li>字节流
<ul>
<li>字节输入流：读 //父类：InputStream 常用子类：FileInputStream</li>
<li>字节输出流：写 //父类：OutputStream 常用子类：FileOutputStream</li>
</ul></li>
<li>字符流
<ul>
<li>字符输入流：读</li>
<li>字符输出流：写</li>
</ul></li>
</ul></li>
<li>IO流使用套路：
<ol type="1">
<li>创建：创建流对象</li>
<li>操作：读、写
<ul>
<li>读：read()</li>
<li>写：write()</li>
</ul></li>
<li>关闭：释放流资源
<ul>
<li>close()</li>
</ul></li>
</ol></li>
</ul>
<p>文件复制：</p>
<ul>
<li>方案1：循环一次读写1个字节数据 （程序性能低）</li>
<li>方案2：循环一次读写多个字节数据（性能高）</li>
</ul>
<p>读数据的方法：</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//一次读取1个字节数据，返回实际读取到的字节数据；读取到文件末尾时返回：-1</span></span><br><span class="line"><span class="type">int</span>  <span class="title function_">read</span><span class="params">()</span>  </span><br><span class="line">    </span><br><span class="line">    </span><br><span class="line"><span class="comment">//一次最多读取buf.length个字节数据，把读取到的字节数据存储到buf数组中，并返回实际读取字节数据的个数</span></span><br><span class="line"><span class="comment">//读取到文件末尾时返回：-1</span></span><br><span class="line"><span class="type">int</span>  <span class="title function_">read</span><span class="params">(<span class="type">byte</span>[] buf)</span>    </span><br><span class="line"></span><br><span class="line"></span><br></pre></td></tr></table></figure>
<p>在IO体系下，java提供了高效流（提高读写文件的效率）</p>
<ul>
<li>读文件：BufferedInputStream</li>
<li>写文件：BufferedOutputStream</li>
</ul>
<p>在IO流中基础流只有两个：字节流、字符流</p>
<p>BufferedInputStream流的创建： 读数据</p>
<ul>
<li>自己没有读数据的能力，需要依赖字节输入流实现读数据</li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//构造方法： public  BufferedInputStream( InputStream  is )</span></span><br><span class="line"></span><br><span class="line"><span class="type">BufferedInputStream</span> <span class="variable">bis</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">BufferedInputStream</span>( <span class="keyword">new</span> <span class="title class_">FileInputStream</span>(<span class="string">&quot;关联文件&quot;</span>) );</span><br></pre></td></tr></table></figure>
<p>BufferedOutputStream流的创建： 写数据</p>
<ul>
<li>自己没有写数据的能力，需要依赖字节输出流实现读数据</li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//构造方法： public  BufferedOutputStream( OutputStream  os )</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//覆盖写入</span></span><br><span class="line"><span class="type">BufferedOutputStream</span> <span class="variable">bos</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">BufferedOutputStream</span>( <span class="keyword">new</span> <span class="title class_">FileOutputStream</span>(<span class="string">&quot;关联文件&quot;</span>) );</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">//追加写入 （构造方法的第二个参数为true）</span></span><br><span class="line"><span class="type">FileOutputStream</span> <span class="variable">fos</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">FileOutputStream</span>(<span class="string">&quot;关联文件&quot;</span> , <span class="literal">true</span>); <span class="comment">//追加写入</span></span><br><span class="line"><span class="type">BufferedOutputStream</span> <span class="variable">bos</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">BufferedOutputStream</span>(  fos );<span class="comment">//当前流有具有追加写入能力</span></span><br></pre></td></tr></table></figure>
<h2 id="properties">Properties</h2>
<p>Properties类：</p>
<ol type="1">
<li>作为Map集合的子类存在（存储的数据：key、value）</li>
<li>可以结合IO流使用 （读、写）</li>
</ol>
<p>Properties类的基本使用：</p>
<ol type="1">
<li>作为集合使用</li>
<li>结合IO流使用</li>
</ol>
<p>构造方法：</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="type">Properties</span> <span class="variable">prop</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">Properties</span>();</span><br></pre></td></tr></table></figure>
<p>常用方法：</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//向Properties集合中存储：key、value</span></span><br><span class="line">setPorperty(String key , String value)</span><br><span class="line"></span><br><span class="line"><span class="comment">//根据指定的key，获取Properties集合中对应的value    </span></span><br><span class="line">String <span class="title function_">getProperty</span><span class="params">(String key)</span></span><br><span class="line"> </span><br><span class="line"><span class="comment">//获取Properties集合中所有的key元素    </span></span><br><span class="line">Set&lt;String&gt;  <span class="title function_">stringPropertyNames</span><span class="params">()</span>;   </span><br><span class="line"></span><br><span class="line"><span class="comment">//借用字节输入流，读取配置文件，读取配置文件中的数据会存储到Properties集合中</span></span><br><span class="line">load(InputStream  is )</span><br></pre></td></tr></table></figure>
<p>在开发中，通常会使用到配置文件，而配置文件格式通常分为：</p>
<ol type="1">
<li>XML文件</li>
<li>properties文件</li>
<li>....</li>
</ol>
<p>Properties类的作用：</p>
<ul>
<li>读取开发中使用的到.properties配置文件
<ul>
<li>properties配置文件中的数据是以key/value形式体现</li>
<li>把properties配置文件中的key，存储到Properties类中的key元素下</li>
<li>把properties配置文件中的value，存储到Properties类中的value元素下</li>
</ul></li>
</ul>
<p>ResourceBundle工具类</p>
<ul>
<li>作用： 读取项目工程下src目录中的.properties配置文件</li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//获取ResourceBundle对象 （必须保证properties配置文件存放在src目录下）</span></span><br><span class="line"><span class="type">ResourceBundle</span> <span class="variable">rb</span> <span class="operator">=</span> ResourceBundle.getBundle(<span class="string">&quot;properites配置文件名[不包含后缀名]&quot;</span>)</span><br><span class="line"> </span><br><span class="line"><span class="comment">//根据给定的key，获取value    </span></span><br><span class="line"><span class="type">String</span> <span class="variable">value</span> <span class="operator">=</span> rb.getString(<span class="string">&quot;key&quot;</span>)     </span><br></pre></td></tr></table></figure>
<h2 id="递归">递归</h2>
<p>什么是递归？</p>
<ul>
<li>递归是应用于方法上的解决方案：方法自己调用自己</li>
</ul>
<p>递归 = 递进 + 回归</p>
<ul>
<li>递进 ：前进</li>
<li>回归： 后退</li>
</ul>
<p>递归的弊端：</p>
<ul>
<li><p>当递归调用的方法过多时，会造成栈内存的溢出</p></li>
<li><p>解决方案： 队列结构</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">1. 获取所有的File对象，存储到集合中</span><br><span class="line">2. 遍历集合</span><br><span class="line">   判断：是文件</span><br><span class="line">        判断：是否为java文件</span><br><span class="line">   判断：是目录</span><br><span class="line">        存储到集合中   </span><br><span class="line">  </span><br><span class="line">   细节： 从集合中获取一个数据后，该数据在集合中就无用了   </span><br></pre></td></tr></table></figure></li>
</ul>
<p>回顾上午内容：</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//读写字节数组</span></span><br><span class="line"><span class="type">int</span> <span class="title function_">read</span><span class="params">(<span class="type">byte</span>[] buf)</span>; <span class="comment">//最多读取buf.length个长度的字节数据，把读取的字节数据存储到buf数组中</span></span><br><span class="line">                      <span class="comment">//返回实际读取到字节数据的个数，读取到文件末尾返回：-1</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//把buf数组中从index开始向后取len个字节数据写入到文件中</span></span><br><span class="line"><span class="keyword">void</span> <span class="title function_">write</span><span class="params">(<span class="type">byte</span>[] buf , <span class="type">int</span> index , <span class="type">int</span> len)</span></span><br><span class="line">   </span><br><span class="line">    </span><br><span class="line">    </span><br><span class="line"><span class="comment">//字节缓冲流（高效流）   本身不具备读写能力，需要依赖字节流</span></span><br><span class="line"><span class="comment">//读数据：BufferedInputStream</span></span><br><span class="line"><span class="comment">//写数据：BufferedOutputStream    </span></span><br><span class="line"><span class="type">BufferedInputStream</span> <span class="variable">bis</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">BufferedInputStream</span>(<span class="keyword">new</span> <span class="title class_">FileInputStream</span>(<span class="string">&quot;关联文件&quot;</span>))</span><br><span class="line">    </span><br><span class="line"><span class="type">BufferedOutputStream</span> <span class="variable">bos</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">BufferedOutputStream</span>(<span class="keyword">new</span> <span class="title class_">FileOutputStream</span>(<span class="string">&quot;关联文件&quot;</span>))    </span><br><span class="line">    </span><br><span class="line">    </span><br><span class="line"></span><br><span class="line"><span class="comment">//读取properties配置文件</span></span><br><span class="line">方式<span class="number">1</span>：Properties类</span><br><span class="line">方式<span class="number">2</span>：ResourceBundle类    </span><br><span class="line"></span><br><span class="line"><span class="type">Properties</span> <span class="variable">prop</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">Properties</span>();</span><br><span class="line">prop.load(<span class="keyword">new</span> <span class="title class_">FileInputStream</span>(<span class="string">&quot;xxxx.properties&quot;</span>));</span><br><span class="line"><span class="type">String</span> <span class="variable">value</span> <span class="operator">=</span> prop.getProperty(<span class="string">&quot;key&quot;</span>)</span><br><span class="line">    </span><br><span class="line">    </span><br><span class="line"><span class="comment">//xxx.properties必须存放在当前项目工程的src目录下</span></span><br><span class="line"><span class="type">ResourceBundle</span> <span class="variable">rb</span> <span class="operator">=</span> ResourceBundle.getBundle(<span class="string">&quot;xxxx&quot;</span>);<span class="comment">//不需要指定后缀名</span></span><br><span class="line"><span class="type">String</span> <span class="variable">vaule</span> <span class="operator">=</span> rb.getString(<span class="string">&quot;key&quot;</span>);</span><br></pre></td></tr></table></figure>
<h2 id="字符流">字符流</h2>
<p>为什么使用字符流？</p>
<ul>
<li>针对纯文本文件中的中文数据，进行读写操作</li>
</ul>
<p>为什么字节流读取中文数据时有：乱码？</p>
<ul>
<li>答案：编码表</li>
</ul>
<h3 id="编码表">编码表</h3>
<p>概念：</p>
<ul>
<li>编码
<ul>
<li>把看得懂的数据，变为看不懂的数据</li>
</ul></li>
<li>解码
<ul>
<li>把看不懂的数据，变为看得懂的数据</li>
</ul></li>
</ul>
<p>在进行编码、解码时必须保证使用相同的编码表。</p>
<p>如果编码表不同，会出现：乱码</p>
<p>编码表：</p>
<ul>
<li>把生活中的数据和计算机中的数据整合在一起，存放在一张表格中</li>
</ul>
<table>
<thead>
<tr class="header">
<th>生活中的数据</th>
<th>编码值</th>
<th>计算机中的数据</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>A</td>
<td>65</td>
<td>01010101001010101</td>
</tr>
<tr class="even">
<td>0</td>
<td>48</td>
<td>01010101001011101</td>
</tr>
<tr class="odd">
<td>a</td>
<td>97</td>
<td>01010101001010111</td>
</tr>
</tbody>
</table>
<p>字符流： 以字符为单位对文件进行读写操作 //读写都是做为字符数据</p>
<ul>
<li>字符输入流：读</li>
<li>字符输出流：写</li>
</ul>
<p>字符流可以读取中文的原因：</p>
<ul>
<li>字符流 = 字节流 + 编码表
<ul>
<li>底层还是使用字节流读写数据，但是由于指定编码表，那么就可以一次读写2或3个字节数据</li>
</ul></li>
</ul>
<p>字符输出流：java.io.Writer类</p>
<ul>
<li>Writer类是一个抽象类（不能实例化）</li>
<li>常用子类：FileWriter</li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//创建字符输出流</span></span><br><span class="line"><span class="type">Writer</span> <span class="variable">w</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">FileWriter</span>(<span class="string">&quot;关联文件&quot;</span>); <span class="comment">//覆盖写入</span></span><br><span class="line"><span class="type">Writer</span> <span class="variable">w</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">FileWriter</span>(<span class="string">&quot;关联文件&quot;</span> , <span class="literal">true</span> ); <span class="comment">//追加写入</span></span><br></pre></td></tr></table></figure>
<p>字符流 = 字节流 + 编码表</p>
<ul>
<li>内置：缓冲区（数组）</li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">字符输出流对象.flush();<span class="comment">//刷新流（把缓冲区中的数据写入到文件） </span></span><br></pre></td></tr></table></figure>
<p>字符输入流：java.io.Reader类</p>
<ul>
<li>是一个抽象类</li>
<li>常用子类：FileReader</li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="type">Reader</span> <span class="variable">r</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">FileReader</span>(<span class="string">&quot;关联文件&quot;</span>);</span><br></pre></td></tr></table></figure>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//一次读取1个字符数据</span></span><br><span class="line"><span class="type">int</span> <span class="variable">data</span> <span class="operator">=</span> r.read();  <span class="comment">//data中存储的是字符数据的编码值</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//一次读取多个字符数据</span></span><br><span class="line"><span class="type">int</span> <span class="variable">len</span> <span class="operator">=</span> r.read( <span class="type">char</span>[]  cbuf )<span class="comment">//一次最多读取cbuf.length个字符数据，并把读取的字符数据存储到cbuf数组中。  返回实际读取到的字符数据个数。 读取到文件末尾返回：-1</span></span><br></pre></td></tr></table></figure>
<p>缓冲流（高效流）：</p>
<ul>
<li>字节缓冲流
<ul>
<li>BufferedInputStream：读</li>
<li>BufferedOutputStream：写</li>
</ul></li>
<li>字符缓冲流（本身不具备读写能力，需要依赖基本的字符流）
<ul>
<li>BufferedReader：读</li>
<li>BufferedWriter：写</li>
</ul></li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//字符输入缓冲流</span></span><br><span class="line"><span class="type">BufferedReader</span> <span class="variable">br</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">BufferedReader</span>(<span class="keyword">new</span> <span class="title class_">FileReader</span>(<span class="string">&quot;关联文件&quot;</span>));</span><br><span class="line"></span><br><span class="line"><span class="comment">//字符输出缓冲流</span></span><br><span class="line"><span class="type">BufferedWriter</span> <span class="variable">bw</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">BufferWriter</span>(<span class="keyword">new</span> <span class="title class_">FileWriter</span>(<span class="string">&quot;关联文件&quot;</span>));<span class="comment">//覆盖写入</span></span><br><span class="line"><span class="type">BufferedWriter</span> <span class="variable">bw</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">BufferWriter</span>(<span class="keyword">new</span> <span class="title class_">FileWriter</span>(<span class="string">&quot;关联文件&quot;</span>,<span class="literal">true</span>));<span class="comment">//追加写入</span></span><br></pre></td></tr></table></figure>
<p>字符缓冲流，提供了特有方法：</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">BufferedReader类中特有方法：</span><br><span class="line">String <span class="title function_">readLine</span><span class="params">()</span>;<span class="comment">//一次读取一行数据(以&quot;\r\n&quot;结尾) ，读取到文件末尾时返回：null</span></span><br><span class="line"></span><br><span class="line">BufferedWriter类中特有方法：</span><br><span class="line"><span class="keyword">void</span>  <span class="title function_">newLine</span><span class="params">()</span>;<span class="comment">//写入换行符（跨平台）    </span></span><br></pre></td></tr></table></figure>
<h2 id="转换流">转换流</h2>
<p>转换流的作用：读写特定编码表的文件</p>
<ul>
<li>FileReader类默认是UTF-8编码表（无法读GBK编码表的文件）</li>
</ul>
<p>输入流：InputStreamReader</p>
<ul>
<li>自身没有读数据的能力，需要依赖字节输入流</li>
</ul>
<p>输出流：OutputStreamWriter</p>
<ul>
<li>自身没有写数据的能力，需要依赖字节输出流</li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//InputStreamReader(InputStream 字节输入流, String 编码表名字) </span></span><br><span class="line"><span class="comment">//创建输入流，并指定关联文件使用的编码表</span></span><br><span class="line"><span class="type">InputStreamReader</span> <span class="variable">isr</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">InputStreamReader</span>(<span class="keyword">new</span> <span class="title class_">FileInputStream</span>(<span class="string">&quot;关联文件&quot;</span>),<span class="string">&quot;GBK&quot;</span>);</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">//OutputStreamWriter(OutputStream 字节输出流, String 编码表名字)</span></span><br><span class="line"><span class="comment">//创建输出流， 并指定关联文件使用的编码表</span></span><br><span class="line"><span class="type">OutputStreamWriter</span> <span class="variable">osw</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">OutputStreamWriter</span>(<span class="keyword">new</span> <span class="title class_">FileOutputStream</span>(<span class="string">&quot;文件&quot;</span>),<span class="string">&quot;GBK&quot;</span>);</span><br></pre></td></tr></table></figure>
<p>字符流的工作原理：</p>
<ul>
<li>利用了转换流实现：字节流和字符流之间的转换</li>
</ul>

    </div>

    
    
    

    <footer class="post-footer">
          <div class="reward-container">
  <div>请我一杯咖啡吧！</div>
  <button>
    赞赏
  </button>
  <div class="post-reward">
      <div>
        <img src="/images/wChat.png" alt="Ethan Liu 微信">
        <span>微信</span>
      </div>

  </div>
</div>

          

<div class="post-copyright">
<ul>
  <li class="post-copyright-author">
      <strong>本文作者： </strong>Ethan Liu
  </li>
  <li class="post-copyright-link">
      <strong>本文链接：</strong>
      <a href="http://ethanliu6.github.io/2024/04/30/JavaNotes/JavaSE%E8%BF%9B%E9%98%B6/day11/JavaSE%E8%BF%9B%E9%98%B6%E2%80%94%E2%80%94Day10-11-%E9%9A%8F%E5%A0%82%E5%B0%8F%E8%AE%B0/" title="JavaSE进阶——Day10-11 随堂小记">http://ethanliu6.github.io/2024/04/30/JavaNotes/JavaSE进阶/day11/JavaSE进阶——Day10-11-随堂小记/</a>
  </li>
  <li class="post-copyright-license">
      <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <span class="exturl" data-url="aHR0cHM6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL2xpY2Vuc2VzL2J5LW5jLXNhLzQuMC8="><i class="fab fa-fw fa-creative-commons"></i>BY-NC-SA</span> 许可协议。转载请注明出处！
  </li>
</ul>
</div>


          <div class="post-tags">
              <a href="/tags/Java/" rel="tag"><i class="fa fa-tag"></i> Java</a>
              <a href="/tags/Java%E8%BF%9B%E9%98%B6/" rel="tag"><i class="fa fa-tag"></i> Java进阶</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/2024/04/30/JavaNotes/JavaSE%E8%BF%9B%E9%98%B6/day11/JavaSE%E8%BF%9B%E9%98%B6%E2%80%94%E2%80%94Day11-Properties%E9%9B%86%E5%90%88%E7%B1%BB%E3%80%81%E9%80%92%E5%BD%92%E3%80%81%E5%AD%97%E8%8A%82%E6%B5%81%E3%80%81%E6%89%93%E5%8D%B0%E6%B5%81/" rel="prev" title="JavaSE进阶——Day11 字节流、打印流">
                  <i class="fa fa-angle-left"></i> JavaSE进阶——Day11 字节流、打印流
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/2024/05/01/JavaNotes/MySQL/day02/day02-MySQL%E9%AB%98%E7%BA%A7%E7%AC%94%E8%AE%B0/" rel="next" title="MYSQL基础语法（下）">
                  MYSQL基础语法（下） <i class="fa fa-angle-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






    <div class="comments" id="SOHUCS" sid="1502379c0afe7ad5cc2fbcbd302858b9"></div>
</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">

  <div class="copyright">
    &copy; 2023-2024 – 
    <span itemprop="copyrightYear">2024</span>
    <span class="with-love">
      <i class="fa fa-heart"></i>
    </span>
    <span class="author" itemprop="copyrightHolder">Is Ethan's</span>
  </div>
<div class="wordcount">
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-line"></i>
    </span>
    <span title="站点总字数">113k</span>
  </span>
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="站点阅读时长">6:51</span>
  </span>
</div>
<div class="busuanzi-count">
    <span class="post-meta-item" id="busuanzi_container_site_uv">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-item" id="busuanzi_container_site_pv">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>

    </div>
  </footer>

  
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up fa-lg"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>
  <a role="button" class="book-mark-link book-mark-link-fixed"></a>

  <span class="exturl github-corner" data-url="aHR0cHM6Ly9naXRodWIuY29tL0V0aGFuTGl1Ni8=" title="在 GitHub 上关注我" aria-label="在 GitHub 上关注我"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></span>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/next-theme-pjax/0.6.0/pjax.min.js" integrity="sha256-vxLn1tSKWD4dqbMRyv940UYw4sXgMtYcK6reefzZrao=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.33/fancybox/fancybox.umd.js" integrity="sha256-+2+qOqR8CKoHh/AsVR9k2qaDBKWjYNC2nozhYmv5j9k=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/medium-zoom/1.1.0/medium-zoom.min.js" integrity="sha256-ZgMyDAIYDYGxbcpJcfUnYwNevG/xi9OHKaR/8GK+jWc=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/lozad.js/1.16.0/lozad.min.js" integrity="sha256-mOFREFhqmHeQbXpK2lp4nA3qooVgACfh88fpJftLBbc=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script><script src="/js/bookmark.js"></script><script src="/js/pjax.js"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/hexo-generator-searchdb/1.4.1/search.js" integrity="sha256-1kfA5uHPf65M5cphT2dvymhkuyHPQp5A53EGZOnOLmc=" crossorigin="anonymous"></script>
<script src="/js/third-party/search/local-search.js"></script>

  <script class="next-config" data-name="pdf" type="application/json">{"object_url":{"url":"https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.2.12/pdfobject.min.js","integrity":"sha256-g2xji1rlE3KsGVClvuxTbcR0Kn2+wtQADSff2Tbb4zA="},"url":"/lib/pdf/web/viewer.html"}</script>
  <script src="/js/third-party/tags/pdf.js"></script>



  <script src="/js/third-party/fancybox.js"></script>



  
  <script data-pjax async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>




  

  <script class="next-config" data-name="enableMath" type="application/json">true</script><script class="next-config" data-name="mathjax" type="application/json">{"enable":true,"tags":"all","js":{"url":"https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.js","integrity":"sha256-MASABpB4tYktI2Oitl4t+78w/lyA+D7b/s9GEP0JOGI="}}</script>
<script src="/js/third-party/math/mathjax.js"></script>


  <script src="https://cdnjs.cloudflare.com/ajax/libs/quicklink/2.3.0/quicklink.umd.js" integrity="sha256-yvJQOINiH9fWemHn0vCA5lsHWJaHs6/ZmO+1Ft04SvM=" crossorigin="anonymous"></script>
  <script class="next-config" data-name="quicklink" type="application/json">{"enable":true,"home":true,"archive":true,"delay":true,"timeout":3000,"priority":true,"url":"http://ethanliu6.github.io/2024/04/30/JavaNotes/JavaSE%E8%BF%9B%E9%98%B6/day11/JavaSE%E8%BF%9B%E9%98%B6%E2%80%94%E2%80%94Day10-11-%E9%9A%8F%E5%A0%82%E5%B0%8F%E8%AE%B0/"}</script>
  <script src="/js/third-party/quicklink.js"></script>
<script class="next-config" data-name="changyan" type="application/json">{"enable":true,"appid":"cyxf6tytI","appkey":"90987f30c4b5248baad5a04c7a6abfe1","count":true}</script>
<script src="/js/third-party/comments/changyan.js"></script>

</body>
</html>
